package cn.com.hbhgkj.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;

@Entity
@Table(name="crs_copyright_registeration")
@Indexed
@XmlRootElement
public class CopyrightRegisteration extends BaseObject implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long id;
    private String serialNum;
    private String copyrighter;
    private String productName;
    private String contact;
    private String phoneNum;
    private String mobileNum;
    private String email;
    private Integer applyFormType;
    private Long applyFormId;
    private String registDate;

    @Id @GeneratedValue(strategy=IDENTITY) @DocumentId    
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="serialNum", length=50)
    @Field
    public String getSerialNum() {
        return this.serialNum;
    }
    
    public void setSerialNum(String serialNum) {
        this.serialNum = serialNum;
    }
    
    @Column(name="copyrighter", length=500)
    @Field
    public String getCopyrighter() {
        return this.copyrighter;
    }
    
    public void setCopyrighter(String copyrighter) {
        this.copyrighter = copyrighter;
    }
    
    @Column(name="productName", length=300)
    @Field
    public String getProductName() {
        return this.productName;
    }
    
    public void setProductName(String productName) {
        this.productName = productName;
    }
    
    @Column(name="contact", length=200)
    @Field
    public String getContact() {
        return this.contact;
    }
    
    public void setContact(String contact) {
        this.contact = contact;
    }
    
    @Column(name="phoneNum", length=100)
    @Field
    public String getPhoneNum() {
        return this.phoneNum;
    }
    
    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }
    
    @Column(name="mobileNum", length=100)
    @Field
    public String getMobileNum() {
        return this.mobileNum;
    }
    
    public void setMobileNum(String mobileNum) {
        this.mobileNum = mobileNum;
    }
    
    @Column(name="email", length=100)
    @Field
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="applyFormType")
    @Field
    public Integer getApplyFormType() {
        return this.applyFormType;
    }
    
    public void setApplyFormType(Integer applyFormType) {
        this.applyFormType = applyFormType;
    }
    
    @Column(name="applyFormId")
    @Field
    public Long getApplyFormId() {
        return this.applyFormId;
    }
    
    public void setApplyFormId(Long applyFormId) {
        this.applyFormId = applyFormId;
    }
    
    @Column(name="registDate", length=20)
    @Field
    public String getRegistDate() {
        return this.registDate;
    }
    
    public void setRegistDate(String registDate) {
        this.registDate = registDate;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CopyrightRegisteration pojo = (CopyrightRegisteration) o;

        if (serialNum != null ? !serialNum.equals(pojo.serialNum) : pojo.serialNum != null) return false;
        if (copyrighter != null ? !copyrighter.equals(pojo.copyrighter) : pojo.copyrighter != null) return false;
        if (productName != null ? !productName.equals(pojo.productName) : pojo.productName != null) return false;
        if (contact != null ? !contact.equals(pojo.contact) : pojo.contact != null) return false;
        if (phoneNum != null ? !phoneNum.equals(pojo.phoneNum) : pojo.phoneNum != null) return false;
        if (mobileNum != null ? !mobileNum.equals(pojo.mobileNum) : pojo.mobileNum != null) return false;
        if (email != null ? !email.equals(pojo.email) : pojo.email != null) return false;
        if (applyFormType != null ? !applyFormType.equals(pojo.applyFormType) : pojo.applyFormType != null) return false;
        if (applyFormId != null ? !applyFormId.equals(pojo.applyFormId) : pojo.applyFormId != null) return false;
        if (registDate != null ? !registDate.equals(pojo.registDate) : pojo.registDate != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (serialNum != null ? serialNum.hashCode() : 0);
        result = 31 * result + (copyrighter != null ? copyrighter.hashCode() : 0);
        result = 31 * result + (productName != null ? productName.hashCode() : 0);
        result = 31 * result + (contact != null ? contact.hashCode() : 0);
        result = 31 * result + (phoneNum != null ? phoneNum.hashCode() : 0);
        result = 31 * result + (mobileNum != null ? mobileNum.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (applyFormType != null ? applyFormType.hashCode() : 0);
        result = 31 * result + (applyFormId != null ? applyFormId.hashCode() : 0);
        result = 31 * result + (registDate != null ? registDate.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("id").append("='").append(getId()).append("', ");
        sb.append("serialNum").append("='").append(getSerialNum()).append("', ");
        sb.append("copyrighter").append("='").append(getCopyrighter()).append("', ");
        sb.append("productName").append("='").append(getProductName()).append("', ");
        sb.append("contact").append("='").append(getContact()).append("', ");
        sb.append("phoneNum").append("='").append(getPhoneNum()).append("', ");
        sb.append("mobileNum").append("='").append(getMobileNum()).append("', ");
        sb.append("email").append("='").append(getEmail()).append("', ");
        sb.append("applyFormType").append("='").append(getApplyFormType()).append("', ");
        sb.append("applyFormId").append("='").append(getApplyFormId()).append("', ");
        sb.append("registDate").append("='").append(getRegistDate()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
